#ifndef type_compil_h
#define type_compil_h

#include <iostream>
#include <vector>
#include "3adCode.hpp"


class Type {
	friend class TypeArray;
	friend class TypeArrayIndexList;
	friend class TypeInter;

	protected:
	typedef enum { 
		TYPE_INTEGER =0, 
		TYPE_REAL =1, 
		TYPE_BOOLEAN =2, 
		TYPE_CHAR =3, 
		TYPE_STRING =4
	} BaseType;

	typedef enum {
		TYPE_ARRAY =5, 
		TYPE_RECORD =6, 
		TYPE_POINTER =7, 
		TYPE_INTERVAL =8, 
		TYPE_ENUM =9 
	} UserType;
	
	typedef enum {
		TYPE_TEMP =20,
		TYPE_NIL
	} TempType;

	int theType;

	public:
	virtual void show();
	virtual ~Type() {};
	virtual bool operator==( const Type &toCompare );
	virtual bool operator!=(const Type &toCompare ) ;
	virtual Type * clone() ;
	virtual bool isOfBaseType(); 
	virtual bool isApplicable(CodeInstruction operation);
};



#endif
